<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page" />
<%@ page import="com.lmpop.trade.ti_organize.*" %>
<%@page import="com.lmpop.trade.ts_role.*" %>
<%
		String user_id = bean.GenTradeId();
		String cust_id = "";	
		if( session.getAttribute("session_cust_id") != null ){
			cust_id = session.getAttribute("session_cust_id").toString();
		}
		Ti_organizeInfo ti_organize = new Ti_organizeInfo();
		String orgSelect  = ti_organize.getOrganizeByUpIdSelect(cust_id,"000000000000000");  
		
		Ts_roleInfo ts_roleInfo = new Ts_roleInfo();
		List rolelist = ts_roleInfo.getListByPk(cust_id);
%>
<html>
  <head>
    <title>新增管理员</title>
		<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
		<script type='text/javascript' src='/dwr/interface/Ti_organizeInfo.js'></script>
		<script type='text/javascript' src='/dwr/interface/Ti_adminInfo.js'></script>
		<script type='text/javascript' src='/dwr/engine.js'></script>
		<script type='text/javascript' src='/dwr/util.js'></script>
		<script type="text/javascript" src="admin.js" charset="UTF-8"></script>
		<script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
</head>

<body>
	<h1>新增管理员</h1>
	<!--table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>您可以按“行业”或“关键字”订阅</h4>
		  <span>1、填写关键字，您将及时了解与该产品相关的所有商机。</span><br/>
		  <span>2、为了更准确订阅，建议你选择产品所属的行业大类和行业子类。</span>
		  </td>
        </tr>
      </table-->
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="15%">
				用户名<font color="red">*</font>
			</td>
			<td><input name="user_name" id="user_name" type="text" maxlength="10" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
			<td align="right" width="15%">
				真实姓名<font color="red">*</font>
			</td>
			<td><input name="real_name" id="real_name" type="text" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				用户密码<font color="red">*</font>
			</td>
			<td><input name="passwd" id="passwd" type="password" maxlength="16" /></td>
			<td align="right" width="15%">
				确认密码<font color="red">*</font>
			</td>
			<td><input name="c_passwd" id="c_passwd" type="password" maxlength="16" /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				部门<font color="red">*</font>
			</td>
			<td colspan="3">
				<select name="sort1" id="sort1" onChange="setSecondClass(this.value);" >
          <option value="">请选择</option>
          <%=orgSelect%>
        </select>  
        <select name="sort2" id="sort2"  onChange="setTherdClass(this.value);" style="display:none;">
					  <option value="">请选择</option>
				</select> 
				<select name="sort3" id="sort3" style="display:none;" >
					  <option value="">请选择</option>
				</select> 
				<input name="org_id" id="org_id" type="hidden" />
				
			</td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				角色<font color="red">*</font>
			</td>
			<td colspan="3">
				<%
					int size = 0;
					if (rolelist != null && rolelist.size() > 0) {
						Hashtable map = new Hashtable();
						size = rolelist.size();
						for (int i = 0; i < rolelist.size(); i++) {
							map = (Hashtable) rolelist.get(i);
							String role_code = "",role_name = "";
							if (map.get("role_code") != null) {
								role_code = map.get("role_code").toString();
							}
							if (map.get("role_name") != null) {
								role_name = map.get("role_name").toString();
							}
				%>
				<input name="role_code<%=i%>" id="role_code<%=i%>" value="<%=role_code%>" type="checkbox" /><%=role_name%>
				<%
						}
					}
				%>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				密码提示问题:
			</td>
			<td><input name="passwd_ques" id="passwd_ques" type="text" maxlength="50" onBlur="this.value=trim(this.value);" /></td>
			<td align="right" width="15%">
				密码提示答案:
			</td>
			<td><input name="passwd_answer" id="passwd_answer" type="text" maxlength="50" onBlur="this.value=trim(this.value);" /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				电话:
			</td>
			<td><input name="phone" id="phone" type="text" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
			<td align="right" width="15%">
				邮箱:
			</td>
			<td><input name="email" id="email" type="text" maxlength="30" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "   /></td>
		</tr>
		
	
		<tr>
			<td align="right" width="15%">
				手机:
			</td>
			<td><input name="cellphone" id="cellphone" type="text" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
			<td align="right" width="15%">
				传真:
			</td>
			<td><input name="fax" id="fax" type="text" maxlength="20" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				QQ:
			</td>
			<td><input name="qq" id="qq" type="text" maxlength="15" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
			<td align="right" width="15%">
				MSN:
			</td>
			<td><input name="msn" id="msn" type="text" maxlength="30" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "   /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				备注:
			</td>
			<td colspan="3"><input name="remark" id="remark" type="text" maxlength="25" size="40" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "  /></td>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>" />
				<input type="hidden" name="linkSize" value="<%=size%>" id="linkSize" />
				<input name="role_code" id="role_code" type="hidden" value="" />
				<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>" />
				<input name="user_state" id="user_state" type="hidden" value="0" />
				<input name="user_type" id="user_type" type="hidden" value="1" />
				<input type="hidden" name="bpm_id" value="9820" />
				<input class="buttoncss" type="button" name="Submit2" id="Submit2" value="提交" onclick="submitValue()" />&nbsp;&nbsp;
				<input class="buttoncss" type="button" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
